home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / winfun1a / security.frm next >
Text File  |  1999-08-26  |  5KB  |  129 lines

  1. VERSION 5.00
  2. Begin VB.Form SecurityForm 
  3.    BackColor       =   &H8000000A&
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "-Security-"
  6.    ClientHeight    =   1350
  7.    ClientLeft      =   45
  8.    ClientTop       =   405
  9.    ClientWidth     =   3255
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1350
  14.    ScaleWidth      =   3255
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   3  'Windows Default
  17.    Begin VB.TextBox WrongCounter 
  18.       Height          =   375
  19.       Left            =   3360
  20.       MaxLength       =   1
  21.       TabIndex        =   3
  22.       Text            =   "3"
  23.       Top             =   120
  24.       Width           =   255
  25.    End
  26.    Begin VB.TextBox PasswordText 
  27.       Height          =   375
  28.       Left            =   120
  29.       TabIndex        =   2
  30.       Text            =   "Enter the Password!"
  31.       Top             =   120
  32.       Width           =   3015
  33.    End
  34.    Begin VB.CommandButton ExitButton 
  35.       Caption         =   "Exit"
  36.       Height          =   495
  37.       Left            =   1680
  38.       MousePointer    =   10  'Up Arrow
  39.       TabIndex        =   1
  40.       Top             =   720
  41.       Width           =   1455
  42.    End
  43.    Begin VB.CommandButton EnterButton 
  44.       Caption         =   "Enter"
  45.       Height          =   495
  46.       Left            =   120
  47.       MousePointer    =   10  'Up Arrow
  48.       TabIndex        =   0
  49.       Top             =   720
  50.       Width           =   1455
  51.    End
  52. End
  53. Attribute VB_Name = "SecurityForm"
  54. Attribute VB_GlobalNameSpace = False
  55. Attribute VB_Creatable = False
  56. Attribute VB_PredeclaredId = True
  57. Attribute VB_Exposed = False
  58. '--------------------------------------------------------------------
  59. Rem Made ▀y: Mike Canejo
  60. Rem E-mail me at: IamMikeC@aol.com
  61. '--------------------------------------------------------------------
  62. Private Sub EnterButton_Click() 'if the Enter button is clicked then do the below
  63. If PasswordText = LCase$("password") Then
  64. 'If the password is X then do something
  65. MsgBox "Correct password!", vbSystemModal + vbInformation + vbOKOnly, "Valid"
  66. 'If its right, display this message
  67. MsgBox "Put your code here to do something if its right", vbSystemModal + vbInformation + vbOKOnly, "Command here" 'replace this line with your choice if it's right
  68. Else
  69. If WrongCounter = "1" Then
  70. 'if the counter is 1 then do this
  71. This& = MsgBox("Your system will now crash!", vbSystemModal + vbOKCancel, "Confirm")
  72. 'display message
  73. If This& = vbCancel Then MsgBox "-Sorry...You cant Cancel!", vbSystemModal + vbCritical + vbOKOnly, "Error"
  74. 'if the user clicks Cancel then do this
  75. MsgBox "Your System is now crashing. Please wait..", vbSystemModal + vbInformation + vbOKOnly, "Info"
  76. 'displays message'i did this just for a prank or joke..it doesnt really harm your computer in any way :)
  77.  
  78. 'ScreenBlackOut Me
  79. 'WinShutdown
  80. 'WinReboot
  81. 'WinForceClose'---------------------------[Pick a command to use]
  82. 'WinLogUserOff
  83. 'HideTaskbar
  84. 'HideWindowsToolBar
  85. 'HideStartButton
  86. 'Use one of these Commands if the password is wrong 3 times
  87.  
  88. WrongCounter = "3" 'Counter = "3" to start over
  89. End 'Ends program
  90. End If 'Ends the If
  91. WrongCounter = Val(WrongCounter) - 1 'make the counter 1 number less than it was
  92. If WrongCounter = "1" Then 'i used this to make the message make sense
  93. MsgBox "The password you've entered is invalid! You have " & WrongCounter & " try left until System Failure!", vbSystemModal + vbCritical + vbOKOnly, "Error"
  94. 'displays error message
  95. Else
  96. MsgBox "The password you've entered is invalid! You have " & WrongCounter & " tries left until System Failure!", vbSystemModal + vbCritical + vbOKOnly, "Error"
  97. 'displays error message
  98. End If 'End the If
  99. End If 'End the If
  100. End Sub
  101.  
  102. Private Sub ExitButton_Click() 'If the Exit button is clciked then do the below
  103. Unload Me 'Unload the program
  104. End Sub
  105.  
  106. Private Sub Form_Load() ' when the form loads, do this
  107. CenterForm Me 'Centers the form in the screen
  108. StayOnTop Me 'Keeps the form OnTop of everything
  109. 'PreventFromClosing
  110. 'DisableCtrlAltDel
  111. 'EnableCtrlAltDel
  112. Rem Use a command for the loading part
  113. End Sub
  114.  
  115. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) 'when the user clicks unload or the X button
  116. 'use this incase the user clicks the unload from the taskbar
  117. Value& = MsgBox("Are you sure you want to exit?", vbSystemModal + vbInformation + vbYesNo, "Exit")
  118. 'hold outcome of the message
  119. If Value& = vbYes Then 'if the user clicks Yes then do something
  120. End 'do this when the user clicks Yes
  121. End If 'Ends the If
  122. Cancel = 1 'makes the form not unload automatically ..only unloads from the above Yes or No statement
  123. End Sub
  124.  
  125. Private Sub PasswordText_Click() 'if the textbox is clicked then check for text
  126. If PasswordText = "Enter the Password!" Then PasswordText = ""
  127. 'clears the textbox if it has the X text in it
  128. End Sub
  129.